package cn.udrm.water.base.v1.administration.dto;

import java.util.List;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import cn.udrm.water.base.v1.administration.entities.AdministrationUnit;

@Mapper(componentModel="spring")
public interface AdministrationUnitDtoMapper {

	@Mappings({
		@Mapping(source="parent.id", target="parentGuid"),
		@Mapping(source="parent.name", target="parentName")
	})
	public AdministrationUnitDto from(AdministrationUnit administrationUnit);
	public AdministrationUnit fromAdministrationUnitDto(AdministrationUnitDto administrationUnitDto);
	
	public List<AdministrationUnitDto> from(List<AdministrationUnit> administrationUnit);
}
